<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  // 全局错误监测
  window.onerror = function () {
    console.log(2)
    console.log(arguments)
  }
  function waitLine(n) {
    return new Promise((resolve, reject) => {
      if (n>0) {
        resolve(true)
      } else {
        reject(false)
      }
    })
  }
  (async function work () {
    console.log(await waitLine(-2))
  })()
</script>
</html>